<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = new Array(30);
        for(i=0;i<30;i++){
            arr[i] = i*2+2;
        }
        // console.log(arr);
        var sum = 0;
        for(i=0;i<arr.length;i++){
            sum = sum+arr[i]
            if(i%5==4){
                console.log(sum/5);
                sum = 0;
            }
        }
    </script>
</body>
</html>